package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.common.filter.CurrentUserHolder;
import com.nineclock.system.dto.SysCompanyUserDTO;
import com.nineclock.system.service.OrganizationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("organization")
public class OrganizationController {

    @Autowired
    private OrganizationService organizationService;

    /**
     * 接口名称：组织架构: 查询组织所有员工
     * 接口路径：GET/sys/organization/members/simple
     */
    @ApiOperation("组织架构: 查询组织所有员工")
    @GetMapping("/members/simple")
    public Result<List<SysCompanyUserDTO>> queryCompanyMemberList(){
        List<SysCompanyUserDTO> companyUserDTOList=organizationService.queryCompanyMemberList();
        return Result.success(companyUserDTOList);
    }
}
